There are occasions where an operation such as document preparation or image processing is executed by software operating on a computer, and the operation result or a file already stored in a storage medium of the computer is sent to an external printer to perform printing. Printing from the software to the printer is performed through services provided by an OS (Operating System) and a printer driver that controls the printer connected to the computer and via a printer port.
[Outline of Computer]
A computer comprises many hardware resources such as a central processing unit (CPU), storage devices (a memory, a hard disk, etc.), input devices (a keyboard, a mouse, etc.), output devices (a display, etc.), and card slots for connecting to peripheral devices (a printer, a scanner, etc.). These hardware devices operate under the control of an OS stored in a storage device.
Various application programs used in the computer run under the OS. The OS provides basic functions used mutually by many application programs, e.g. input/output functions such as keyboard entry and screen output, and management of a disk and memory, and controls the whole system of the computer.
The hardware devices of the computer and peripheral devices are produced by a plurality of manufacturers, and the specifications thereof may differ among manufacturers. The OS controls all the operations of the computer and absorbs differences in specifications of different hardware devices to provide an environment common to application programs.
Developers of application programs can save the time and labor for development and unify the operability of the application programs by making use of functions provided by the OS. An application program developed for use with a certain OS can basically be used in any computer in which the OS can run.
There are a large number of different kinds of OS, represented by MS-DOS (registered trademark), UNIX (registered trademark), Linux, FreeBSD (registered trademark), etc. Among them, Windows (registered trademark) series available from Microsoft is the most popular OS for use by corporations and general home users. Mac OS (registered trademark) available from Apple is widely used in the DTP industry and the multimedia industry. Servers of corporations and scientific institutions often use UNIX (registered trademark)-based OS's developed by various companies and UNIX (registered trademark)-based OS's such as Linux and FreeBSD (registered trademark), which are distributed without charge. In recent years, Windows NT (registered trademark) and Windows 2000 (registered trademark) available from Microsoft have been increasing the share of the market as OS's for servers.
[Outline of Printer Driver]
FIG. 11 shows the arrangement of a printer driver of Windows 2000, which is a typical OS, and the related services, and outlines the operation thereof. A computer 1 operates under an OS 3. When an application program 4 running on the OS 3 outputs to a printer 69, complicated processing is executed.
The OS 3 has two operating modes, i.e. a kernel mode 8 and a user mode 9. In the kernel mode 8, all instructions for operating the OS 3 are executable. If an erroneous instruction is executed, there may be an adverse effect on the whole system. The user mode 9 is completely open to the user to run an application program, etc.
In the user mode 9, instructions for operating the OS 3 are limited so that an adverse effect is not exerted on the system. Because execution of instructions that may have an adverse effect on the system is limited, an environment easy for the user to use is provided. The OS provides many system functions to operate the computer. System functions automatically activated when the OS is started or modules for implementing the functions are referred to as “services”.
FIG. 11 shows services, such as a GDI32 (61), a GRE (GDI Rendering Engine) 62, a printer graphic driver 63, a printer interface driver 64, a spooler 65, a language monitor 66, and a port monitor 67. FIG. 11 further shows a printer device driver 68 for controlling the printer 69.
These services operate in either the kernel mode 8 or the user mode 9. The printer device driver 68 operates in the kernel mode 8. The GDI32 (61) is an abbreviation for “Graphic Device Interface” for 32-bit systems, which is a service providing an interface that is concerned with output to a device, such as plotting, device context, metafile, coordinates, font, etc.
The GRE 62 is a service for generating data for printing. Regarding inherent functions of the printer 69, e.g. the model or type thereof, the GRE 62 calls the printer graphic driver 63 to generate data for printing. The printer graphic driver 63 operates in the kernel mode 8 to generate data for printing. The printer graphic driver 63 generates RAW data (described later).
The printer interface driver 64 generates data for printing in the user mode 9. The printer interface driver 64 provides the function of making various settings regarding printing, e.g. a number of copies to be printed, a type of paper used, and black-and-white/color printing setting.
The spooler 65 is a service for temporarily storing data for printing in a storage medium and for managing output to the printer 69. The language monitor 66 provides a service for converting data for printing from the spooler 65 to printable data. Further, the language monitor 66 provides a service for interpreting information from the printer 69. For example, the language monitor 66 provides information concerning the printer 69, e.g. a paper jam, or a toner-out condition, to a higher-order service and the user. The port monitor 67 controls and monitors a port used for printing.
The printer device driver 68 controls the printer 69 directly. The printer interface driver 64, the GRE 62 and the language monitor 66 provide standard functions provided by the OS 3. However, the printer 69 has unique functions depending on the model or type thereof. These unique functions are supported by a driver program, e.g. a mini-driver, supplied by the manufacturer.
The printer interface driver 64 provides the above-described unique functions that call the mini-driver. The printer graphic driver 63 is mostly provided by the manufacturer supplying the printer 69. The printer graphic driver 63 can provide functions unique to the printer 69. The language monitor 66 is generally different for each model or type of the printer 69 and supplied by the manufacturer.
Data for printing is temporarily stored in a storage medium, e.g. a memory or a hard disk, (this is called “spooling”). When the printer 69 is ready to process it, or when there is a request from the printer 69, the stored print data is sent to the printer 69 to print it. This operation is executed by the spooler 65. In Windows, two formats, i.e. EMF (Enhanced Metafile Format), and RAW, are used for data for spooling that is passed to the spooler 65.
EMF is a format for printers developed for use in 32-bit Windows systems. EMF data can be generated by an application program or the like. However, printers that can receive and print EMF data are limited to those compatible with EMF. A printer that is not compatible with EMF needs to convert EMF data to RAW data to print it. RAW data depends on the model of printer 69. Therefore, RAW data is generated by a driver corresponding to each individual printer 69.
[Flow of Printing]
The following is an outline of the flow of print data when printing is performed from the application program 4 to the printer 69. The application program 4 sends a print request to the GDI32 (61). The print request and output data from the application program 4 are transmitted to the GDI32 (61) operating in the user mode of the OS 3. If the format of the data is EMF, the GDI32 (61) sends the data to the spooler 65 as data for spooling.
If the format of the data is not EMF, the GDI32 (61) passes the data to the GRE 62. The GRE 62 calls the printer graphic driver 63 to generate data for spooling from the data. The generated data for spooling is sent to the printer interface driver 64. The printer interface driver 64 makes various settings for printing and passes the data to the spooler 65.
The spooler 65 spools the data to create a temporary file and stores it in the hard disk. The spooler 65 reads the temporary file and passes the data to the language monitor 66. The language monitor 66 generates printable print data suitable for the printer 69. The print data is transmitted to the printer device driver 68 through the port monitor 67.
The procedure of printing to the printer 69 will be described below with reference to the flowchart of FIG. 12. The application program 4 sends a print request to the GDI32 (61) (S300) and transmits data to be printed thereto. The GDI32 (61) receives the print request and data (S301) and analyzes the data (S302). Then, the GDI32 (61) judges the format of the data (S303). If the data format is EMF (if “Yes” is the answer), the GDI32 (61) sends the data to the spooler 65 as data for spooling (S315→S316).
If the data format is not EMF (if “No” is the answer), the GDI32 (61) passes the data to the GRE 62 (S304). The GRE 62 receives the data (S305), calls the printer graphic driver 63, and passes the data thereto (S306). The printer graphic driver 63 receives the data (S307) and generates data for spooling (S308). The printer graphic driver 63 passes the generated data for spooling to the GRE 62 (S309). The GRE 62 receives the data for spooling (S310) and sends it to the printer interface driver 64 (S311).
The printer interface driver 64 receives the data for spooling (S312), makes various settings for printing (S313), and transmits the data to the spooler 65 (S314→S316). The spooler 65 receives the data for spooling (S316), spools the data to create a temporary file (S317), and stores it in the hard disk (S318). The temporary file is read by the spooler 65 and passed to the language monitor 66 (S319). The language monitor 66 generates data for printing from the temporary file (S320) and sends it to the port monitor 67 (S321).
The port monitor 67 receives the data for printing (S322) and sends it to the printer device driver 68 (S323). The printer device driver 68 finally transmits the data for printing to the printer 69 (S324). Thus, the data requested to be printed from the application program 4 is printed. While being transmitted to the printer device driver 68, the spooled data is under supervision of the language monitor 66 and the port monitor 67.
International Publication No. WO 02/091195 discloses a common interface that operates in the kernel mode to perform transmission and reception of data between device drivers of a computer. The proposed common interface is not concerned with a technique whereby a print history is obtained to manage and limit the user's print operation for the purpose of security and so forth.
Meanwhile, it is important to manage the operation of printing from a computer to a printer and also the data to be printed from the viewpoint of security, i.e. protection of private information, and management of secret data. Accordingly, there are occasions where it is necessary to obtain a print history and to limit the user's print operation. It is sometimes desirable to perform print control when a specific file is to be printed, for example, by suspending the print operation, or printing fake data in place of the actual print data.
However, it is difficult to perform such print control with an OS used in a computer. Print data is sent to a printer through a plurality of services and device drivers of the OS that operate in the user or kernel mode and through a series of complicated operations thereof. Therefore, it is difficult to accurately control print data under print control. Controlling a driver operating in the kernel mode may cause an unstable operation of the OS. Therefore, the conventional print control system does not perform such control.